feat(client): per-verb *_with_response siblings (0.12.0)#68
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Design + plan for the get_with_response … request_with_response siblings, and the Active Index entry. Bundle stays active/draft until merge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ship bookkeeping: mark design.md + plan.md shipped (pr: 68, outcome filled), move the bundle from changes/active/ to changes/archive/, and flip its Index line from Active to Archived. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the one-call ergonomic form of
send_with_responseto both clients:get_with_response,post_with_response,put_with_response,patch_with_response,delete_with_response, andrequest_with_responseonAsyncClientandClient. Each requiresresponse_modeland returnstuple[httpx2.Response, T]— for the "I need response metadata and a typed body" case (Link-header pagination, ETag / rate-limit reads) without thebuild_request(...)+send_with_response(...)two-step.Closes the deferred "Per-verb-with-response siblings" item. Ships as 0.12.0 (additive, no breaking changes).
What's in it
_prepare_requestfrom_request_with_body(behavior-preserving) so the plain and with-response paths share request-building._request_with_body_with_responsehelper tosend_with_response. No@overloadstubs — single call shape. InheritsMissingDecoderError(pre-HTTP) andDecodeErrorwrapping for free.head/optionsvariant (HEAD is bodiless, OPTIONS rarely decoded);request_with_response(method, url, ...)is the escape hatch.architecture/client.mdnote + atyping.assert_typetest for the(Response, T)return.pyproject.tomlis intentionally not bumped.Design + plan:
planning/changes/active/2026-06-16.01-per-verb-with-response/.Test plan
just test— 678 passed, 100% coveragejust lint— clean (ruff format/check + ty)DecodeError,MissingDecoderErrorfires before the HTTP calltyping.assert_typestatic-type assertions for the tuple returnmkdocs build --strict— clean🤖 Generated with Claude Code